package com.j3a.journal.model;

// Generated 21 oct. 2014 14:53:50 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Journaliste generated by hbm2java
 */
@Entity
@Table( name = "journaliste"
        , catalog = "journal" )
public class Journaliste implements java.io.Serializable {

    /**
     * 
     */
    private static final long            serialVersionUID         = 1L;
    private String                       journalisteId;
    private User                         user;
    private String                       journalisteNom;
    private Date                         journalisteDateNaiss;
    private Set<JournalistePersonnalite> journalistePersonnalites = new HashSet<JournalistePersonnalite>( 0 );
    private Set<JournalisteJournal>      journalisteJournals      = new HashSet<JournalisteJournal>( 0 );
    private Set<Article>                 articles                 = new HashSet<Article>( 0 );

    public Journaliste() {
    }

    public Journaliste( String journalisteId ) {
        this.journalisteId = journalisteId;
    }

    public Journaliste( String journalisteId, User user, String journalisteNom, Date journalisteDateNaiss,
            Set<JournalistePersonnalite> journalistePersonnalites, Set<JournalisteJournal> journalisteJournals,
            Set<Article> articles ) {
        this.journalisteId = journalisteId;
        this.user = user;
        this.journalisteNom = journalisteNom;
        this.journalisteDateNaiss = journalisteDateNaiss;
        this.journalistePersonnalites = journalistePersonnalites;
        this.journalisteJournals = journalisteJournals;
        this.articles = articles;
    }

    @Id
    @Column( name = "JOURNALISTE_ID", unique = true, nullable = false, length = 30 )
    public String getJournalisteId() {
        return this.journalisteId;
    }

    public void setJournalisteId( String journalisteId ) {
        this.journalisteId = journalisteId;
    }

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "USER_ID" )
    public User getUser() {
        return this.user;
    }

    public void setUser( User user ) {
        this.user = user;
    }

    @Column( name = "JOURNALISTE_NOM", length = 40 )
    public String getJournalisteNom() {
        return this.journalisteNom;
    }

    public void setJournalisteNom( String journalisteNom ) {
        this.journalisteNom = journalisteNom;
    }

    @Temporal( TemporalType.DATE )
    @Column( name = "JOURNALISTE_DATE_NAISS", length = 10 )
    public Date getJournalisteDateNaiss() {
        return this.journalisteDateNaiss;
    }

    public void setJournalisteDateNaiss( Date journalisteDateNaiss ) {
        this.journalisteDateNaiss = journalisteDateNaiss;
    }

    @OneToMany( fetch = FetchType.LAZY, mappedBy = "journaliste" )
    public Set<JournalistePersonnalite> getJournalistePersonnalites() {
        return this.journalistePersonnalites;
    }

    public void setJournalistePersonnalites( Set<JournalistePersonnalite> journalistePersonnalites ) {
        this.journalistePersonnalites = journalistePersonnalites;
    }

    @OneToMany( fetch = FetchType.LAZY, mappedBy = "journaliste" )
    public Set<JournalisteJournal> getJournalisteJournals() {
        return this.journalisteJournals;
    }

    public void setJournalisteJournals( Set<JournalisteJournal> journalisteJournals ) {
        this.journalisteJournals = journalisteJournals;
    }

    @OneToMany( fetch = FetchType.LAZY, mappedBy = "journaliste" )
    public Set<Article> getArticles() {
        return this.articles;
    }

    public void setArticles( Set<Article> articles ) {
        this.articles = articles;
    }

}
